/**
 * template 的代码标签是不会直接再页面上展示的
 */
// const template = document.getElementById('my-paragraph');

// document.body.appendChild(template.content.cloneNode(true));

customElements.define(
  'my-paragraph',
  class extends HTMLElement {
    constructor() {
      super();
    }
    connectedCallback() {
      const template = document.getElementById('my-paragraph');
      const shadow = this.attachShadow({ mode: 'open' });
      shadow.appendChild(template.content.cloneNode(true));
    }
  }
);
